package day03.note;

import java.util.Random;
import java.util.Scanner;

public class txt4 {
    public static void main(String[] args) {

        Random r=new Random();

        int num= r.nextInt(30);
        System.out.println(num);

        Scanner sc=new Scanner(System.in);
        int answer=sc.nextInt();

        if (answer==num){
            System.out.println("猜对了");
        }else  if (answer>num){
            System.out.println("猜大了");
        }else {
            System.out.println("猜小了");
        }

        while (answer!=num){
            answer=sc.nextInt();
            if (answer> num){
                System.out.println("猜大了，请继续输入答案");
            }else if(answer<num){
                System.out.println("猜小了，请继续输入答案");
            }else {
                    System.out.println("猜对了"   );
            }
        }



    }
}
